package org.apache.flink.runtime.resourcemanager.registration;

import static org.apache.flink.util.Preconditions.checkNotNull;

import org.apache.flink.runtime.clusterframework.types.ResourceID;
import org.apache.flink.runtime.instance.InstanceID;
import org.apache.flink.runtime.resourceprovider.ResourceProviderGateway;

/**
 * This class is responsible for grouping the TaskExecutorGateway and the InstanceID of a registered
 * task executor.
 */
/**
 * @类名: ResourceProviderConnection
 * @说明: 资源提供者连接
 *
 * @author   leehom
 * @Date	 2024年2月20日 下午12:31:59
 * 修改记录：
 *
 * @see 	 
 */
public class ResourceProviderConnection {

    private final ResourceID resourceID;

    private final InstanceID instanceID;

    private final ResourceProviderGateway taskExecutorGateway;

    public ResourceProviderConnection(ResourceID resourceID, ResourceProviderGateway taskExecutorGateway) {
        this.resourceID = checkNotNull(resourceID);
        this.instanceID = new InstanceID();
        this.taskExecutorGateway = checkNotNull(taskExecutorGateway);
    }

    public ResourceID getResourceID() {
        return resourceID;
    }

    public InstanceID getInstanceID() {
        return instanceID;
    }

    public ResourceProviderGateway getTaskExecutorGateway() {
        return taskExecutorGateway;
    }
}
